package com.haixiaoke.saas.role.service.impl;

import com.haixiaoke.saas.role.domain.RoleDept;
import com.haixiaoke.saas.role.mapper.RoleDeptMapper;
import com.haixiaoke.saas.role.service.IRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 企业端角色和部门关联Service业务层处理
 *
 * @author panda
 * @date 2023-12-29
 */
@Service
public class RoleDeptServiceImpl implements IRoleDeptService {
    @Autowired
    private RoleDeptMapper roleDeptMapper;

    /**
     * 查询企业端角色和部门关联
     *
     * @param roleId 企业端角色和部门关联主键
     * @return 企业端角色和部门关联
     */
    @Override
    public RoleDept selectBizRoleDeptByRoleId(Long roleId) {
        return roleDeptMapper.selectRoleDeptByRoleId(roleId);
    }

    /**
     * 查询企业端角色和部门关联列表
     *
     * @param roleDept 企业端角色和部门关联
     * @return 企业端角色和部门关联
     */
    @Override
    public List<RoleDept> selectBizRoleDeptList(RoleDept roleDept) {
        return roleDeptMapper.selectRoleDeptList(roleDept);
    }

    /**
     * 新增企业端角色和部门关联
     *
     * @param roleDept 企业端角色和部门关联
     * @return 结果
     */
    @Override
    public int insertBizRoleDept(RoleDept roleDept) {
        return roleDeptMapper.insertRoleDept(roleDept);
    }

    /**
     * 修改企业端角色和部门关联
     *
     * @param roleDept 企业端角色和部门关联
     * @return 结果
     */
    @Override
    public int updateBizRoleDept(RoleDept roleDept) {
        return roleDeptMapper.updateRoleDept(roleDept);
    }

    /**
     * 批量删除企业端角色和部门关联
     *
     * @param roleIds 需要删除的企业端角色和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleDeptByRoleIds(Long[] roleIds) {
        return roleDeptMapper.deleteRoleDeptByRoleIds(roleIds);
    }

    /**
     * 删除企业端角色和部门关联信息
     *
     * @param roleId 企业端角色和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleDeptByRoleId(Long roleId) {
        return roleDeptMapper.deleteRoleDeptByRoleId(roleId);
    }

    @Override
    public int batchRoleDept(List<RoleDept> list) {
        return roleDeptMapper.batchRoleDept(list);
    }
}
